@echo off
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )

@echo off
(echo set Wshell=CreateObject^("Wscript.Shell"^)
echo wscript.Sleep 50
echo Wshell.SendKeys "123456" //123456改成自己的MySQL密码      
echo Wshell.SendKeys "{ENTER}")>"%tmp%\inputpassword.vbs"
cd /d D:\kxc\MySql\mysql-8.0.32-winx64\bin    //D:\kxc\MySql\mysql-8.0.32-winx64\bin为文件路径，改成自己的bin路径
start "" "%tmp%\inputpassword.vbs"
mysql -u root -p